const fs = require('fs')

function getFolder(path, components=[]) {
  const files = fs.readdirSync(path)
  files.forEach(function (item) {
    let stat = fs.lstatSync(path + '/' + item)
    if (stat.isDirectory() === true && item != 'components') {
      components.push(path + '/' + item)
      getFolder(path + '/' + item, components)
    }
  })
  return components
}

module.exports = {
  getFolder
}